<template>
  <div>
    <div class="login">
      <div class="login_box">
        <p>欢迎注册</p>
        <p>严选商城</p>
      </div>
      <div>
        <el-input v-model="mobile" placeholder="请输入用户名" clearable class="login_input"></el-input>
        <el-input
          placeholder="请输入密码"
          v-model="pwod"
          show-password
          class="login_input"
        ></el-input>
        <el-button type="success" plain class="login_but" @click="OnLogin">登录</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            mobile:'',
            pwod:'',
        }
    },
    methods:{
        OnLogin(){
          this.$APIClient.login({
            params:{
              pwd:this.pwd,
              mobile:this.mobile
            }
          }).then((res)=>{
            console.log(res);
            var token = res.data.data.token;
            console.log(res.data.data.token);
            localStorage.setItem('token',token);
            alert("登录成功");
            this.$router.push('/Mine')
          })
        }
    }
};
</script>

<style>
.login{
    width: 100%;
    height: 40rem;
    /* background-color: aqua; */
  
}
.login_ingput{
    width: 70%;
    margin-left: 15%;
}
.login_box{
    margin-top: 5rem;
    width: 5rem;
    height: 5rem;
    font-size: 1rem;
    margin: 0 auto;
     
}

.login_but{
    margin-top: 2rem;
    width: 50%;
    margin-left: 25%;
}

</style>